<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5-改变this指向apply</title>
</head>
<body>
    <img src="images/r03.jpg" alt="">
    <script type="text/javascript">
        function setData(x,y){
            console.log(x+y);
            console.log(this);
        }
        var obj = {
            brand:'华为',
            price:2999
        };
        setData.apply(obj,[1,2]);

    </script>
</body>
</html>